Update remix monorepo to v2 (major) #149
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
1.19.3
->2.0.1
1.19.3
->2.0.1
1.19.3
->2.0.1
1.19.3
->2.0.1
Release Notes
remix-run/remix (@remix-run/dev)
v2.0.1
Compare Source
Patch Changes
getDependenciesToBundle
to handle ESM packages without main exports (#7272)package.json
in theirexports
field so that their path can be resolvedserverBuildPath
extension is.cjs
(#7180)@remix-run/[email protected]
v2.0.0
Compare Source
Major Changes
The
create-remix
CLI has been rewritten to feature a cleaner interface, Git repo initialization and optionalremix.init
script execution. The interactive template prompt and official Remix stack/template shorthands have also been removed so that community/third-party templates are now on a more equal footing. (#6887)create-remix
has been moved out of the Remix CLI since it's not intended for use within an existing Remix applicationremix create
command is no longer available.Enable built-in PostCSS and Tailwind support by default. (#6909)
remix.config.js
via thepostcss:false
and/ortailwind:false
flagsDrop React 17 support (#7121)
Require Node >=18.0.0 (#6939)
Compile server build to Node 18 (#7292)
await
to be used within a Remix appRemove default Node.js polyfills - you must now opt-into polyfills via the
serverNodeBuiltinsPolyfill
andbrowserNodeBuiltinsPolyfill
configs (#7269)Remove
v2_errorBoundary
flag andCatchBoundary
implementation (#6906)Remove
v2_normalizeFormMethod
future flag - allformMethod
values will be normalized in v2 (#6875)Remove
v2_routeConvention
flag - the flat route file convention is now standard (#6969)Remove
v2_headers
flag - it is now the default behavior to use the deepestheaders
function in the route tree (#6979)The route
meta
API now defaults to the new "V2 Meta" API (#6958)Default to
serverModuleFormat: "esm"
and updateremix-serve
to use dynamic import to support ESM and CJS build outputs (#6949)Remove
serverBuildTarget
config option (#6896)Remove deprecated
REMIX_DEV_HTTP_ORIGIN
env var - useREMIX_DEV_ORIGIN
instead (#6963)Remove
devServerBroadcastDelay
config option (#7063)Remove deprecated
devServerPort
option - use--port
/dev.port
instead (#7078)Remove deprecated
REMIX_DEV_SERVER_WS_PORT
env var - useremix dev
's '--port
/port
option instead (#6965)Stop passing
isTypeScript
toremix.init
script (#7099)Remove
replace-remix-magic-imports
codemod (#6899)Remove deprecated
--no-restart
/restart
cli args/flags - use--manual
/manual
instead (#6962)Remove deprecated
--scheme
/scheme
and--host
/host
cli args/flags - useREMIX_DEV_ORIGIN
instead (#6962)Promote the
future.v2_dev
flag inremix.config.js
to a root leveldev
config (#7002)Remove
browserBuildDirectory
config option (#6900)Remove
serverBuildDirectory
config option ([#6897](https://github.com/remix-run/remix/pull/- Removecodemod
command (#6918)6897))
Removed support for "magic exports" from the
remix
package. This package can be removed from yourpackage.json
and you should update all imports to use the source@remix-run/*
packages: (#6895)Minor Changes
Warn users about obsolete future flags in
remix.config.js
(#7048)Detect built mode via
build.mode
(#6964)build.mode
to determine if HMR should be performedSupport
bun
package manager (#7074)The
serverNodeBuiltinsPolyfill
option (along with the newly addedbrowserNodeBuiltinsPolyfill
) now supports defining global polyfills in addition to module polyfills (#7269)For example, to polyfill Node's
Buffer
global:Patch Changes
Fix importing of PNGs, SVGs, and other assets from packages in
node_modules
(#6813, #7182)Decouple the
@remix-run/dev
package from the contents of the@remix-run/css-bundle
package. (#6982)@remix-run/css-bundle
package are now entirely managed by the Remix compiler@remix-run/dev
without upgrading@remix-run/css-bundle
Allow non-development modes for
remix watch
(#7117)Stop
remix dev
whenesbuild
is not running (#7158)Do not interpret JSX in
.ts
files (#7306)While JSX is supported in
.js
files for compatibility with existing apps and libraries,.ts
files should not contain JSX. By not interpreting.ts
files as JSX,.ts
filescan contain single-argument type generics without needing a comma to disambiguate from JSX:
Enhance obsolete flag warning for
future.v2_dev
if it was an object, and prompt users to lift it to the rootdev
config (#7427)Allow decorators in app code (#7176)
Allow JSX in
.js
files during HMR (#7112)Kill app server when remix dev terminates (#7280)
Support dependencies that import polyfill packages for Node built-ins via a trailing slash (e.g. importing the
buffer
package withvar Buffer = require('buffer/').Buffer
as recommended in their README) (#7198)Dynamic require of "buffer/" is not supported
)Surface errors when PostCSS config is invalid (#7391)
Restart dev server when Remix config changes (#7269)
Remove outdated ESM import warnings (#6916)
Do not trigger rebuilds when
.DS_Store
changes (#7172)Remove warnings for stabilized flags: (#6905)
unstable_cssSideEffectImports
unstable_cssModules
unstable_vanillaExtract
Allow any mode (
NODE_ENV
) (#7113)Replace the deprecated
xdm
package with@mdx-js/mdx
(#4054)Write a
version.txt
sentinel file after server build is completely written (#7299)Updated dependencies:
@remix-run/[email protected]
remix-run/remix (@remix-run/react)
v2.0.1
Compare Source
Patch Changes
UIMatch
forhandle
field (#7464)route.lazy
(#7498)ErrorResponse
instead of just anError
when submitting to a route without anaction
(#7423)@remix-run/[email protected]
v2.0.0
Compare Source
Major Changes
Drop React 17 support (#7121)
Require Node >=18.0.0 (#6939)
Remove
unstable_shouldReload
, which has been replaced byshouldRevalidate
(#6865)The route
meta
API now defaults to the new "V2 Meta" API (#6958)Promote the
future.v2_dev
flag inremix.config.js
to a root leveldev
config (#7002)Remove
v2_errorBoundary
flag andCatchBoundary
implementation (#6906)Remove back-compat layer for
useFetcher
/useFetchers
, which includes a few small breaking changes (#6874)fetcher.type
has been removed since it can be derived from other available informationfetcher.submission
down onto the rootfetcher
object, and prefixed withform
in some cases (fetcher.submission.action
=>fetcher.formAction
)<fetcher.Form method="get">
is now more accurately categorized asstate:"loading"
instead ofstate:"submitting"
to better align with the underlying GET requestRemove
v2_normalizeFormMethod
future flag - allformMethod
values will be normalized in v2 (#6875)Remove deprecated
useTransition
hook in favor ofuseNavigation
-useNavigation
is almost identical with a few exceptions: (#6870)useTransition.type
has been removed since it can be derived from other available informationuseTransition().submission
down onto the rootuseNavigation()
object<Form method="get">
is now more accurately categorized asstate:"loading"
instead ofstate:"submitting"
to better align with the underlying GET navigationRemove
v2_routeConvention
flag - the flat route file convention is now standard. (#6969)Remove
v2_headers
flag - it is now the default behavior to use the deepestheaders
function in the route tree. (#6979)Removed/adjusted types to prefer
unknown
overany
and to align with underlying React Router types (#7319, #7354):useMatches()
return type fromRouteMatch
toUIMatch
LoaderArgs
/ActionArgs
toLoaderFunctionArgs
/ActionFunctionArgs
AppData
changed fromany
tounknown
Location["state"]
(useLocation.state
) changed fromany
tounknown
UIMatch["data"]
(useMatches()[i].data
) changed fromany
tounknown
UIMatch["handle"]
(useMatches()[i].handle
) changed from{ [k: string]: any }
tounknown
Fetcher["data"]
(useFetcher().data
) changed fromany
tounknown
MetaMatch.handle
(used inmeta()
) changed fromany
tounknown
AppData
/RouteHandle
are no longer exported as they are just aliases forunknown
Remove
imagesizes
&imagesrcset
properties fromHtmlLinkDescriptor
,LinkDescriptor
&PrefetchPageDescriptor
types (#6936)Remove deprecated
REMIX_DEV_SERVER_WS_PORT
env var (#6965)remix dev
's '--port
/port
option insteadRemoved support for "magic exports" from the
remix
package. This package can be removed from yourpackage.json
and you should update all imports to use the source@remix-run/*
packages: (#6895)Minor Changes
Navigation
type returned fromuseNavigation
(#7136)route.lazy
for module loading (#7133)Patch Changes
Add
error
tometa()
params so you can render error titles, etc. (#7105)Re-Export
ShouldRevalidateFunctionArgs
type from React Router (#7316)Deduplicate prefetch
link
tags (#7060)Skip preloading of stylesheets on client-side route transitions if the browser does not support
<link rel=preload>
(#7106)load
/error
event on thelink
tagExport proper
ErrorResponse
type for usage alongsideisRouteErrorResponse
(#7244)Use the hostname from
REMIX_DEV_ORIGIN
to connect to the live reload socket (#6923)Use unique key for
script:ld+json
meta descriptors (#6954)Fix live reload port when set explicitly as a prop (#7358)
Fix types for
useLoaderData
when using Yarn PnP (#7137)Updated dependencies:
@remix-run/[email protected]
[email protected]
@remix-run/[email protected]
remix-run/remix (@remix-run/serve)
v2.0.1
Compare Source
Patch Changes
remix-serve
and manual mode (remix dev --manual
) (#7487)require
cache,remix-serve
now correctly re-imports new server changes in CJSbuild.assets
being undefined and crashing when readingbuild.assets.version
@remix-run/[email protected]
@remix-run/[email protected]
v2.0.0
Compare Source
Major Changes
remix-serve
now picks an open port if 3000 is taken (#7278)PORT
env var is set,remix-serve
will use that portremix-serve
picks an open port (3000 unless that is already taken)Integrate manual mode in
remix-serve
(#7231)Remove undocumented
createApp
Node API (#7229)remix-serve
is a CLI, not a libraryRequire Node >=18.0.0 (#6939)
Promote the
future.v2_dev
flag inremix.config.js
to a root leveldev
config (#7002)Default to
serverModuleFormat: "esm"
and updateremix-serve
to use dynamic import to support ESM and CJS build outputs (#6949)Preserve dynamic imports in
remix-serve
for external bundle (#7173)For preparation of using Node's built in fetch implementation, installing the fetch globals is now a responsibility of the app server (#7009)
If you are using
remix-serve
, nothing is requiredIf you are using your own app server, you will need to install the globals yourself
source-map-support
is now a responsibility of the app server (#7009)If you are using
remix-serve
, nothing is requiredIf you are using your own app server, you will need to install
source-map-support
yourself.Patch Changes
remix-serve
usage error message to support ESM projects (#7400)@remix-run/[email protected]
@remix-run/[email protected]
remix-run/remix (remix)
v2.0.1
: v2.0.1Compare Source
Patch Changes
getDependenciesToBundle
to handle ESM packages without main exports (#7272)package.json
in theirexports
field so that their path can be resolvedserverBuildPath
extension is.cjs
(#7180)remix-serve
and manual mode (remix dev --manual
) (#7487)require
cache,remix-serve
now correctly re-imports new server changes in CJSbuild.assets
being undefined and crashing when readingbuild.assets.version
UIMatch
forhandle
field (#7464)route.lazy
(#7498)ErrorResponse
instead of just anError
when submitting to a route without anaction
(#7423)@remix-run/web-fetch
(#7477)crypto.randomBytes
tocrypto.webcrypto.getRandomValues
for file session storage ID generation (#7203)Blob
class instead of polyfill (#7217)Changes by Package 🔗
@remix-run/dev
@remix-run/node
@remix-run/react
@remix-run/serve
Full Changelog:
2.0.0...2.0.1
v2.0.0
: v2.0.0Compare Source
Remix v2
We're so excited to release Remix v2 to you and we really hope this upgrade is one of the smoothest framework upgrades you've ever experienced! That was our primary goal with v2 - something we aimed to achieve through a heavy use of deprecation warnings and Future Flags in Remix v1.
If you are on the latest
1.x
version and you've enabled all future flags and addressed all console warnings, then our hope is that you are 90% of the way to being upgraded for v2. There are always going to be a few things that we can't put behind a flag (like breaking type changes) or come up at the very last moment and don't have time to add as a warning or flag in1.x
.If you're not yet on the latest 1.x version we'd recommend first upgrading to that and resolving any flag/console warnings:
> npx upgrade-remix 1.19.3
Breaking Changes
Below is a very concise list of the breaking changes in v2.
Upgraded Dependency Requirements
Remix v2 has upgraded it's minimum version support for React and Node and now officially requires:
Removed Future Flags
The following future flags were removed and their behavior is now the default - you can remove all of these from your
remix.config.js
file.v2_dev
- New dev server with HMR+HDR (#7002)future.v2_dev
instead of just the boolean value (i.e.,future.v2_dev.port
), you can lift them into a rootdev
object in yourremix.config.js
v2_errorBoundary
- RemovedCatchBoundary
in favor of a singularErrorBoundary
(#6906)v2_headers
- Altered the logic forheaders
in nested route scenarios (#6979)v2_meta
- Altered the return format ofmeta()
(#6958)v2_normalizeFormMethod
- NormalizeformMethod
APIs to uppercase (#6875)v2_routeConvention
- Routes use a flat route convention by default now (#6969)Breaking Changes/API Removals
With deprecation warnings
The following lists other breaking changes/API removals which had deprecation warnings in Remix v1. If you're on the latest
1.19.3
release without any console warnings, then you're probably good to go on all of these!remix.config.js
browserBuildDirectory
toassetsBuildDirectory
(#6900)devServerBroadcastDelay
(#7063)devServerPort
todev.port
(000457e0
)1.x
release, your config flag will befuture.v2_dev.port
, but on a stable2.x
release it will bedev.port
serverModuleFormat
fromcjs
toesm
(#6949)serverBuildTarget
(#6896)serverBuildDirectory
toserverBuildPath
(#6897)serverNodeBuiltinsPolyfill
(#6911@remix-run/react
useTransition
(#6870)fetcher.type
and flattenedfetcher.submission
(#6874)<fetcher.Form method="get">
is now more accurately categorized asstate:"loading"
instead ofstate:"submitting"
to better align with the underlying GET requestimagesrcset
/imagesizes
(#6936)Without deprecation warnings
Unfortunately, we didn't manage to get a deprecation warning on every breaking change or API removal 🙃. Here's a list of remaining changes that you may need to look into to upgrade to v2:
remix.config.js
browserNodeBuiltinsPolyfill
(#7269)postcss
andtailwind
flags (#6909)@remix-run/cloudflare
createCloudflareKVSessionStorage
(#6898)@cloudflare/workers-types
v2 & v3 support (#6925)@remix-run/dev
REMIX_DEV_HTTP_ORIGIN
in favor ofREMIX_DEV_ORIGIN
(#6963)REMIX_DEV_SERVER_WS_PORT
in favor ofdev.port
or--port
(#6965)--no-restart
/restart
flag in favor of--manual
/manual
(#6962)--scheme
/scheme
and--host
/host
in favor ofREMIX_DEV_ORIGIN
instead (#6962)codemod
command (#6918)@remix-run/eslint-config
@remix-run/eslint-config/jest
config (#6903)@remix-run/netlify
@remix-run/netlify
adapter has been removed in favor of the Netlify official adapters (#7058)@remix-run/node
fetch
is no longer polyfilled by default - apps must callinstallGlobals()
to install the polyfills (#7009)fetch
and related APIs are no longer exported from@remix-run/node
- apps should use the versions in the global namespace (#7293)sourceMapSupport.install()
to setup source map support@remix-run/react
unstable_shouldReload
in favor ofshouldRevalidate
(#6865)@remix-run/serve
remix-serve
picks an open port if 3000 is taken andPORT
is not specified (#7278)manual
mode (#7231)createApp
Node API (#7229)@remix-run/vercel
@remix-run/vercel
adapter has been removed in favor of out of the box functionality provided by Vercel (#7035)create-remix
isTypeScript
toremix.init
script (#7099)remix
Breaking Type Changes
V2_
prefixes fromfuture.v2_meta
types as they are now the default behavior (#6958)V2_MetaArgs
->MetaArgs
V2_MetaDescriptor
->MetaDescriptor
V2_MetaFunction
->MetaFunction
V2_MetaMatch
->MetaMatch
V2_MetaMatches
->MetaMatches
V2_ServerRuntimeMetaArgs
->ServerRuntimeMetaArgs
V2_ServerRuntimeMetaDescriptor
->ServerRuntimeMetaDescriptor
V2_ServerRuntimeMetaFunction
->ServerRuntimeMetaFunction
V2_ServerRuntimeMetaMatch
->ServerRuntimeMetaMatch
V2_ServerRuntimeMetaMatches
->ServerRuntimeMetaMatches
unknown
overany
and to align with underlying React Router types (#7319):useMatches()
return type fromRouteMatch
toUIMatch
LoaderArgs
/ActionArgs
toLoaderFunctionArgs
/ActionFunctionArgs
AppData
changed fromany
tounknown
Location["state"]
(useLocation.state
) changed fromany
tounknown
UIMatch["data"]
(useMatches()[i].data
) changed fromany
tounknown
UIMatch["handle"]
(useMatches()[i].handle
) changed from{ [k: string]: any }
tounknown
Fetcher["data"]
(useFetcher().data
) changed fromany
tounknown
MetaMatch.handle
(used inmeta()
) changed fromany
tounknown
AppData
/RouteHandle
are no longer exported as they are just aliases forunknown
New Features
create-remix
CLI (#6887)--template
flag and our ever-growing list of available templates--overwrite
flag (#7062)bun
package manager (#7074)build.mode
(#6964)serverNodeBuiltinsPolyfill.globals
/browserNodeBuiltinsPolyfill.globals
(#7269)redirectDocument
utility to redirect via a fresh document load (#7040, #6842)error
tometa
params so you can render error titles, etc. (#7105)unstable_createRemixStub
now supports addingmeta
/links
functions on stubbed Remix routes (#7186)unstable_createRemixStub
no longer supports theelement
/errorElement
properties on routes. You must useComponent
/ErrorBoundary
to match what you would export from a Remix route module.Other Notable Changes
route.lazy
method internally to load route modules on navigations (#7133)@remix-run/node
atob
/btoa
polyfills in favor of the built-in versions (#7206)@remix-run/dev
package from the contents of the@remix-run/css-bundle
package (#6982)@remix-run/css-bundle
package are now entirely managed by the Remix compiler. Even though it's still recommended that your Remix dependencies all share the same version, this change ensures that there are no runtime errors when upgrading@remix-run/dev
without upgrading@remix-run/css-bundle
.remix-serve
now picks an open port if 3000 is taken (#7278)PORT
env var is set,remix-serve
will use that portremix-serve
picks an open port (3000 unless that is already taken)[email protected]
@remix-run/[email protected]
@remix-run/[email protected]
@remix-run/[email protected]
@remix-run/[email protected]
Changes by Package
create-remix
@remix-run/architect
@remix-run/cloudflare
@remix-run/cloudflare-pages
@remix-run/cloudflare-workers
@remix-run/css-bundle
@remix-run/deno
@remix-run/dev
@remix-run/eslint-config
@remix-run/express
@remix-run/node
@remix-run/react
@remix-run/serve
@remix-run/server-runtime
@remix-run/testing
Full Changelog:
1.19.3...2.0.0
Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about these updates again.
This PR has been generated by Mend Renovate. View repository job log here.